package com.lengxf.milo.model;

import com.lengxf.milo.node.NodeIdBuilder;
import lombok.AllArgsConstructor;
import lombok.Data;
import org.eclipse.milo.opcua.stack.core.types.builtin.DataValue;
import org.eclipse.milo.opcua.stack.core.types.builtin.NodeId;
import org.eclipse.milo.opcua.stack.core.types.builtin.StatusCode;

@Data
@AllArgsConstructor
public class ReadResult {

    private String identifier;
    private NodeId nodeId;
    private DataValue dataValue;

    public static ReadResult badResult(String identifier) {
        return new ReadResult(identifier, NodeIdBuilder.build(identifier), new DataValue(StatusCode.BAD));
    }

}
